package start;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.beans.factory.support.AbstractBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;

public class Main {
    public static void main(String[] args) {
        //ApplicationContext context = new ClassPathXmlApplicationContext("META-INF/beans.xml");
        //I instance = (I) context.getBean("aBean2");
        
        B scope = new B();
        Resource resource = new ClassPathResource("META-INF/beans.xml");        
        ConfigurableBeanFactory beanFactory = new XmlBeanFactory(resource);
        beanFactory.registerScope("b",scope);
        A a = (A) beanFactory.getBean("aBean4");
    }
}
